package com.haste.controller;

import com.haste.pojo.CommonResult;
import com.haste.pojo.Payment;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @ClassName:OrderController
 * @Description:
 * @Author:Haste
 * @Date:2021/2/7 11:03
 */
@RestController
@Slf4j
public class OrderController {
    @Resource
    private RestTemplate restTemplate;
    public static final String PAYMENT_URL = "http://consul-provider8006";
    @GetMapping("/consul/order")
    public String order(){
        return restTemplate.getForObject(PAYMENT_URL+"/consul/payment/",String.class);
    }

}
